function GetCookie(n){
var aCookie = document.cookie.split("; ")
for (var i=0; i < aCookie.length; i++){
var aCrumb = aCookie[i].split("=");
if (n == aCrumb[0])
{
if(aCrumb.length<2)return '';
else	return unescape(aCrumb[1]);
}
}
return ''
}

window.onload=setinit;
function setinit()
{
	//var lcolor = GetCookie('lcolor')
	//var vcolor = GetCookie('skinc');
	var pagesize = GetCookie('skinp');
	//alert(pagesize);
	if( pagesize>0 )
	{
		var fontsize = 12+parseInt(pagesize-1)*2
		b="font-size: "+fontsize+"px;";
		c="font-size: "+(8+fontsize)+"px;";
		x("body",b);
		//x(".tqk_bg1 h1 b",c);
	}
	check_city_len();
}
function x(a,b){
	var c=document.styleSheets[0];
	if(c.addRule){
		c.addRule(a,b);
	}else if(c.insertRule){
		c.insertRule(a+" { "+b+" }",c.cssRules.length);
	}
}

function dz(a)
{
	addJs('/js/3city.js','js3cityID',selinit2);
	b='',c='none';
	if(a==1)b='none',c='';
	$('dz1').style.display=c;
	$('dz2').style.display=b;
}

function selinit2(){NotTQ=false;selinit();}

function addJs(file)
{
	var scriptId=arguments[1];
	var funExec=arguments[2];
	var funcLoading=arguments[3];
	var expire=arguments[4];
	var expFunc=arguments[5];
	var parent=document.getElementsByTagName('head')[0];
	if($('scriptId'))
	{
		var script=$('scriptId');
		script.src=file;
	}
	else
	{
		var script=document.createElement('SCRIPT');
		script.setAttribute('type', 'text/javascript');
		script.setAttribute('src', file);
		script.setAttribute('id', scriptId);
		parent.appendChild(script);
	}
	script.onreadystatechange =  function (){
	if(typeof(funExec)=='function'){if(script.readyState == 'complete' || script.readyState =="loaded"){funExec()}}
	if(script.readyState == 'loading'&&typeof(funcLoading)=='function'){t=setTimeout(funcLoading ,expire )}
	};
	script.onload = function (){(typeof(funExec)=='function')?funExec():""};
	return script;
}
function check_city_len()
{
	try{
		var ctb = document.getElementById('cityname');
		var ctname=ctb.innerText;
		var vlen=ctname.length;
		if(vlen>3){
			ctb.className='citysize';
		}
	}catch(e){}
}